import Taro, {Component} from '@tarojs/taro'
import {View} from '@tarojs/components'
import {connect} from '@tarojs/redux'


import Header from '../../components/IndexHeader'
import Body from '../../components/IndexBody'
import TabBar from '../../components/TabBar'

import './index.scss'


// @connect(({ counter }) => ({
//   counter
// }), (dispatch) => ({
//   add () {
//     dispatch(add())
//   },
//   dec () {
//     dispatch(minus())
//   },
//   asyncAdd () {
//     dispatch(asyncAdd())
//   }
// }))
class Index extends Component {

    constructor(props) {
        super(props)
        this.state = {
            value: ''
        }
        this.onchange = this.onchange.bind(this)
    }

    config = {
        navigationBarTitleText: '瑞金街道'
    }

    onchange(e) {
        this.setState({
            value: e.target.value
        })
    }

    render() {

        return (
            <View className='index'>
                <Header/>
                <Body/>
                {Taro.getEnv() !== Taro.ENV_TYPE.WEAPP && <TabBar/>}
            </View>
        )
    }
}

export default Index
